//
//  SchedulingViewController.m
//  DS_PJ_01
//
//  Created by 宋畅 on 2016/12/17.
//  Copyright © 2016年 zhiqiyun. All rights reserved.
//

#import "SchedulingViewController.h"
#import "WebViewController.h"
@interface SchedulingViewController ()

@property(nonatomic,strong)NSMutableArray *listArray;

@end

@implementation SchedulingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.tableView.backgroundColor = [UIColor whiteColor];

}



-(NSMutableArray *)listArray
{
    if (!_listArray) {
        _listArray = [[NSMutableArray alloc]initWithObjects:@"考勤",@"奖罚",@"出勤",@"审批",@"通知",@"营业操作", nil];
    }
    return _listArray;
}

#pragma mark -------- tableView delegate ----------
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.listArray.count;
}


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *mineCellIdetifier = @"mineCellIdetifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:mineCellIdetifier];
    
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:mineCellIdetifier];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    cell.textLabel.text = self.listArray[indexPath.row];
    
    
    return cell;
    
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if ([self.listArray[indexPath.row] isEqualToString:@"奖罚"]){
        WebViewController *webVC=[[WebViewController alloc]init];
        webVC.webViewURLString=@"http://chief-media.com/html/waiter/manager_rewards_punishments.html";
        webVC.title=@"奖罚";
        [self.navigationController pushViewController:webVC animated:YES];
    }
    else if ([self.listArray[indexPath.row] isEqualToString:@"出勤"]){
        WebViewController *webVC=[[WebViewController alloc]init];
        webVC.webViewURLString=@"http://chief-media.com/html/waiter/manager_chuqin.html";
        webVC.title=@"出勤";
        [self.navigationController pushViewController:webVC animated:YES];
    }
    else if ([self.listArray[indexPath.row] isEqualToString:@"审批"]){
        WebViewController *webVC=[[WebViewController alloc]init];
        webVC.webViewURLString=@"http://chief-media.com/html/waiter/manager_shenpi.html";
        webVC.title=@"审批";
        [self.navigationController pushViewController:webVC animated:YES];
    }
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
